<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head th:fragment="head(title,style)">
    <meta charset="UTF-8">
    <title th:replace="${title}"></title>
    <link rel="stylesheet" type="text/css" th:href="@{/css/public.css}" />
    <link rel="stylesheet" type="text/css" th:href="@{/lib/layui/css/layui.css}" />
    <script th:src="@{/lib/layui/layui.js}" type="text/javascript" charset="utf-8"></script>
    <script th:src="@{/js/public.js}" type="text/javascript" charset="utf-8"></script>
    <style th:replace="${style}"></style>
</head>
<body>
<!--body导航栏切片-->
<div class="header" th:fragment="header(pageName)">
    <div class="layui-container">
        <div class="logo" style="float: left;">
            <a th:href="@{/index}">图书商城</a>
        </div>
        <ul class="layui-nav layui-bg-green" style="float: right;" th:if="${session.user!=null}">
            <li class="layui-nav-item" th:classappend="${pageName=='cart'?'layui-this':''}">
                <a th:href="@{|/${session.user.userName}/shopping_cart|}">购物车</a>
            </li>
            <li class="layui-nav-item">
                <a href="javascript:;">
                    <!--<img src="//t.cn/RCzsdCq" class="layui-nav-img">-->
                    [[${session.user.userName}]]
                </a>
                <dl class="layui-nav-child">
                    <!--<dd><a href="javascript:;">修改信息</a></dd>-->
                    <dd><a th:href="@{|/${session.user.userName}/orders|}">个人订单</a></dd>
                    <dd><a th:href="@{/logout}">退了</a></dd>
                </dl>
            </li>
        </ul>
         <ul class="layui-nav layui-bg-green" style="float: right;" th:if="${session.user==null}">
                <li class="layui-nav-item">
                    <a th:href="@{/login}">登录</a>
                </li>
                <li class="layui-nav-item">
                    <a th:href="@{/register}">注册</a>
                </li>
         </ul>
    </div>
</div>
<!--body底部栏切片-->
<div class="footer" th:fragment="footer">
    &copy; 2022 贵州理工学院
</div>
</body>
</html>